/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models;

import java.io.Serializable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Entity;
import javax.persistence.Temporal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;



/**
 *
 * @author milka
 */
 
 
 @Entity
@Table(name="item_basket" , catalog="", schema="")
@NamedQueries({
    @NamedQuery(name="ItemBasket.findById", query = "SELECT i FROM item_basket i WHERE i.id_product = :id_product" )
	})
public class ItemBasket extends BaseEntity implements Serializable {
    
    
    
    
    @Column(name="count", nullable=false)
    private int count;
	@ManyToOne
    @JoinColumn(name="id_product", referencedColumnName="id")
    private Products product;
	@ManyToOne
    @JoinColumn(name="id_basket", referencedColumnName="id")
    private Users userOrder;
	
	@OneToMany(mappedBy="id_item_basket")
	

    
 
    private static final long serialVersionUID = 1L;

    private Baskets basket;

    
    
     
    public Baskets  getBasket() {
        return basket;
           }
           
           
    public void setBasket(Baskets basket) {
        this.basket = basket;
    }   
      
    
     
    public int  getCount() {
        return count;
           }
           
           
    public void setCount(int count) {
        this.count = count;
    }   
      
      
      
      public Products  getProduct() {
        return product;
           }
           
           
    public void setProduct(Products product) {
        this.product = product;
    }
    
        
    }
    
    